/*--------------------------------+
| ArcEngine-Main.h   			  |
|								  |
| BrokenGlass				      |
|								  |
| Last Change:					  |
+--------------------------------*/

// This file sets up SDL,SFont etc.

#ifndef __MAIN_H__
#define __MAIN_H__

#include "Global.h"

void drawHud();

bool init_sdl(int w, int h, bool fullscreen)
{
	if (SDL_Init(SDL_INIT_VIDEO) < 0)
	{
		printf("ERROR: Unable to init SDL: %s\n", SDL_GetError());
		log_add("ERROR: Unable to init SDL.\n");
		return 1;
	}
	/*if (TTF_Init() == -1) 
	{
		printf("ERROR: Unable to initialize SDL_ttf: %s \n", TTF_GetError());
		log_add("ERROR: Unable to initialize SDL_ttf");
		return 1;
	}*/

	if (fullscreen)
		screen = SDL_SetVideoMode(w, h, 32, SDL_SWSURFACE | SDL_FULLSCREEN); 
	else
		screen = SDL_SetVideoMode(w, h, 32, SDL_SWSURFACE);

	SDL_WM_SetCaption( "ArcEngine - Build 0.1a",0 );

	if (screen == NULL)
	{
		printf("ERROR: Unable to set video mode: 640,480: %s\n", SDL_GetError());
		log_add("ERROR: Unable to set video mode.\n");
		return 1;
	}
	return true;
}

#endif